<template>
  <v-layout type="console">
    <!-- <el-radio-group v-model="nowRouter" size="medium" @change="skip" class="nav-alike" v-show="!$route.meta.hideDetails">
      <el-radio-button :label="e.name"  v-for="(e, i) in thisRouter" :key="i">
        <span class="nav-alike-item">{{ e.meta.title }}</span>
      </el-radio-button>
    </el-radio-group> -->

    <el-tabs v-model="nowRouter" @tab-click="skip" v-show="!$route.meta.hideDetails">
      <el-tab-pane :label="e.meta.title" :name="`${e.name}`" v-for="(e, i) in thisRouter" :key="i" />
    </el-tabs>

    <router-view class="content-detail" />
  </v-layout>
</template>

<script>

export default {
  data() {
    return {
      thisRouter: [],
      nowRouter: this.$route.name,

    };
  },
  methods: {
    skip() {
      let path = `/my/${this.thisRouter.filter(e => e.name == this.nowRouter)[0].path}`
      if (path == this.$route.path) return
      this.$router.push({
        path,
        query: {
          id: this.$route.query.id
        }
      })
    },

  },
  mounted() {
    let temp = this.$router.options.routes.filter(
      e => e.name == 'my' && e.children
    )
    this.thisRouter = temp[0].children.filter(e => !e.meta.hideDetails)

  },
}
</script>
<style lang="less" scoped></style>